﻿
namespace SistemaLogistica.Business.Logic
{
    using System;
    using System.Collections.Generic;
    using SistemaLogistica.Business.Entities;
    using SistemaLogistica.DataAccess;

    public class CargoManager
    {
        private CargoManager() { }

        private static readonly CargoManager instancia = new CargoManager();

        public static CargoManager Instancia
        {
            get { return instancia; }
        }

        public List<Cargo> Buscar(string nombre)
        {
            try
            {
                return CargoData.Instancia.Buscar(nombre);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public Cargo ObtenerPorID(int cargoID)
        {
            try
            {
                return CargoData.Instancia.ObtenerPorID(cargoID);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public void Agregar(Cargo cargo)
        {
            try
            {
                CargoData.Instancia.Agregar(cargo);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public void Actualizar(Cargo cargo)
        {
            try
            {
                CargoData.Instancia.Actualizar(cargo);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public void Eliminar(int cargoID)
        {
            try
            {
                CargoData.Instancia.Eliminar(cargoID);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public List<Cargo> Listar()
        {
            try
            {
                return CargoData.Instancia.Listar();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public List<Cargo> ListarPorArea(int areaID)
        {
            try
            {
                return CargoData.Instancia.ListarPorArea(areaID);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public List<Cargo> ListarPorCargoSuperior(int cargoSuperiorID)
        {
            try
            {
                return CargoData.Instancia.ListarPorCargoSuperior(cargoSuperiorID);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}
